package org.example.utils;

import java.util.ArrayList;

public class DataUtils {


    public static String[][] listToStringArray(ArrayList<String[]> arrayList) {
        int rowCount = arrayList.size();
        int colCount = arrayList.get(0).length;
        String[][] result = new String[rowCount][colCount];

        for (int i = 0; i < rowCount; i++) {
            String[] row = arrayList.get(i);
            for (int j = 0; j < colCount; j++) {
                //解决id转换序号问题
                if (j == 0) {
                    result[i][0] = String.valueOf(i + 1);
                    continue;
                }
                result[i][j] = row[j];
            }
        }

        return result;
    }


}
